#!/usr/bin/env bash
# Copyright Kani Contributors
# SPDX-License-Identifier: Apache-2.0 OR MIT

set -eu

SCRIPT_DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" >/dev/null 2>&1 && pwd )"
REPO_DIR="$(dirname $SCRIPT_DIR)"

shopt -s nullglob
KANI_DRIVER="$REPO_DIR/target/kani/bin/kani-driver"

if [[ ! -x ${KANI_DRIVER} ]]
then
    echo "ERROR: Could not find kani-driver binary."
    echo "Looked for: '${KANI_DRIVER}'"
    echo "Was Kani successfully built first?"
    exit 1
fi

exec -a kani "${KANI_DRIVER}" "$@"
